﻿{extend name="public:base" /}{block name="css"}
<link rel="stylesheet" type="text/css" href="/static/layui/css/layui.css"/>
<link rel="stylesheet" type="text/css" href="__ADMIN__/css/style.css">{/block}{block name="content"}

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-content">
                    <form method="post">
                        <!--<div class="box-item">
                            <div class="form-group row layui-form">
                                <label class="col-sm-1 col-form-label">用户</label>
                                <div class="col-sm-3">
                                    <select name="user_id" lay-search="">
                                        <option value="0"></option>
                                        {volist name="user_list" id="vo"}
                                        <option value="{$vo.id}" {$vo.id == $user_id ? 'selected' : ''}>{$vo.username} / {$vo.mobile}</option>
                                        {/volist}
                                    </select>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>-->

                        <div class="box-item">
                            <div class="form-group row layui-form">
                                <label class="col-sm-1 col-form-label">车辆</label>
                                <div class="col-sm-3">
                                    <select name="car_id" lay-search="" lay-filter="car">
                                        <option value="0"></option>
                                        {volist name="car_list" id="vo"}
                                        <option value="{$vo.id}" data-price="{$vo.price}" {$vo.number== $info.number ?
                                        'selected' : ''}>{$vo.number} / {$vo.model}</option>
                                        {/volist}
                                    </select>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <div class="box-item">
                            <div class="form-group row"><label class="col-sm-1 col-form-label">金额</label>
                                <div class="col-sm-3">
                                    <input type="number" name="price" class="form-control price" placeholder="请输入金额">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                        </div>

                        <input type="hidden" name="id" value="{:input('id')}">

                        <div class="form-group row">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button type="button" class="btn btn-w-m btn-default back-page">返回</button>
                                <button type="button" class="btn btn-w-m btn-primary ajax-post">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

{include file="public/cropper-img-mask" cropper_uploaded_img_ids="cropper_uploaded_img_ids" cropper_uploaded_img_paths="cropper_uploaded_img_paths" crop_preview_box="crop-preview-box" /}{include file="public/preview-img-mask" swiper-id="cropper-preview" /}{/block}


{block name="js"}
<script src="__STATIC__/jquery/jquery-3.1.1.min.js"></script>
<script src="__STATIC__/layui/layui.js"></script>
<script>
    layui.use(['form', 'jquery'], function () {
        var form = layui.form;
        var $ = layui.jquery;

        // 监听类目选择
        form.on('select(car)', function (data) {
            var price = $(data.elem).find("option:selected").data("price");
            $('.price').val(price);
        });
    });
</script>{/block}